import UserContent from "./UserContent";
import {useEffect,useState} from "react";
import {useSelector} from "react-redux";

function UserList(){
    const {userlist} = useSelector(state => state.user)
    useEffect(() => {

    })
    return(
        <ul>
            {
                (userlist && userlist.length > 0) ?
                    (userlist.map((item) => {
                        return(<UserContent key={item.id} username={item.username} avatar={item.avatar}/>)
                    })):
                    (<p>loader...</p>)
            }
        </ul>
    )
}
export default UserList;